interface IIndexType {
  // 返回值类型的目的是告知通过索引取获取到的值是什么类型
  // https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures
  // An index signature property type must be either ‘string’ or ‘number’.

  // [index: number]: string
  [index: string]: string
  // [index: string]: any
}
// 索引签名[index: number]: string 符合
// 索引签名[index: string]: string 不符合  因为严格的字面量赋值监测
// 索引签名[index: string]: any 符合
/**
 * It is possible to support both types of indexers, but the type returned from a numeric indexer must be a subtype of the type returned from the string indexer. 
 * (重要)This is because when indexing with a number, JavaScript will actually convert that to a string before indexing into an object. 
 * That means that indexing with 100 (a number) is the same thing as indexing with "100" (a string), so the two need to be consistent.
 */
const names: IIndexType = ["abc", "cba", "nba"]

export { }